﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace class2_work2
{
    class Program
    {
        static void Main(string[] args)
        {
                 int[] num = new int[] { 3, 4, 5, 6, 9 };
                Console.WriteLine("数组的最大值为：" + num.Max());
                Console.WriteLine("数组的最小值为：" + num.Min());
                Console.WriteLine("数组的最大值为：" + num.Average());
                Console.Read();
                int a = Console.Read();
                Console.WriteLine("请输入你说要构建的个数：" + (a));

                int[] num1 = new int[a];
                for (int i = 0; i < a; i++)
                {
                    string s = Console.ReadLine();
                    int x = int.Parse(s);
                    num1[i] = x;
                }
                int max = num1[0];
                Console.WriteLine("最大值" + max);
                for (int i = 0; i < a; i++)
                {
                    if (max < num1[i])
                        max = num[i];
                }
                int min = num1[0];
                Console.WriteLine("最小值" + min);
                for (int i = 0; i < a; i++)
                {
                    if (min > num1[i])
                        min = num1[i];
                }
                int average = num1[0];
                int all = num1[0];
                for (int i = 0; i < a; i++)
                {
                    all = num[i] + all;
                }
                Console.WriteLine("平均值为" + all / a);
            }
        }
    }
}
